import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty } from 'class-validator';
export class WxLoginDTO {
  @ApiProperty({
    type: 'string',
    description: '登录时获取的 code，可通过wx.login获取',
  })
  js_code: string;

  @ApiProperty({
    type: 'string',
    description: '小程序的appid',
    default: 'wxecac5a7fb8e8f4cc',
  })
  appid: string;

  @ApiProperty({
    type: 'string',
    description: '小程序 appSecret',
    default: '42365a76cf461063de3d9b32dc704488',
  })
  secret: string;

  @ApiProperty({
    type: 'string',
    description: '授权类型，此处只需填写 authorization_code',
    default: 'authorization_code',
  })
  grant_type: string;

  @ApiProperty({
    type: 'string',
    description: '用户名',
    default: '名字',
  })
  nickName: string;

  @ApiProperty({
    type: 'number',
    description: '用户手机号',
    minLength: 11,
    maxLength: 11,
    default: 11111111111,
  })
  @IsNotEmpty({
    message: '手机号不能为空',
  })
  phone: number;
}
